package com.stylefeng.guns.rest.common.exception;


import com.stylefeng.guns.rest.common.util.StringUtils;

/**
 * 参数异常
 */
@SuppressWarnings("serial")
public class ParamException extends RuntimeException{
    private BizExceptionEnum bizExceptionEnum;

	private String attr;

    public BizExceptionEnum getBizExceptionEnum() {
        return bizExceptionEnum;
    }

	public String getAttr() {
		return attr;
	}

	public ParamException(BizExceptionEnum bizExceptionEnum, String attr) {
        this.bizExceptionEnum = bizExceptionEnum;
		this.attr = attr;
    }

    public ParamException(Throwable e) {
		super(e.getMessage(), e);
	}
	
	public ParamException(String message) {
		super(message);
	}
	
	public ParamException(String messageTemplate, Object... params) {
		super(StringUtils.format(messageTemplate, params));
	}
	
	public ParamException(String message, Throwable throwable) {
		super(message, throwable);
	}
	
	public ParamException(Throwable throwable, String messageTemplate, Object... params) {
		super(StringUtils.format(messageTemplate, params), throwable);
	}
}
